Lấy dữ liệu từ hệ thống
Tài liệu này mô tả hai cách lấy dữ liệu xác thực từ hệ thống FPT AI eKYC. Các cách này được sử dụng để lấy dữ liệu từ hệ thống sau khi đã thực hiện các bước xác thực và nhận diện.
1. Lấy dữ liệu callback từ hệ thống FPT AI eKYC
Sau khi hoàn thành một phiên eKYC, hệ thống FPT AI eKYC sẽ gửi dữ liệu trả về cho hệ thống của khách hàng qua một callback URL mà khách hàng đã cung cấp trong phần cấu hình Data retrieve trên eKYC Portal. Dữ liệu này bao gồm các thông tin như mã trạng thái, thông báo lỗi (nếu có), và các thông tin khác liên quan đến phiên eKYC.
1.1. Mẫu request
curl --location --request POST 'your-url' \
--header 'your-key: your-value' \
--data-raw ekyc_data
1.2. Mẫu dữ liệu callback
{
    "uuid": "your-uuid",
    "code": "303",
    "message": "face is not matching with document",
    "ocr": {
        "code": "200",
        "message": "ocr successful",
        "data": [
            {
                "id": "0xxxxxxxxx9",
                "id_prob": "98.66",
                "name": "Nguyễn Văn A",
                "name_prob": "99.09",
                "dob": "dd/mm/yyyy",
                "dob_prob": "98.41",
                "sex": "NAM",
                "sex_prob": "98.30",
                "nationality": "VIỆT NAM",
                "nationality_prob": "99.77",
                "type_new": "cccd_12_front",
                "doe": "dd/mm/yyyy",
                "doe_prob": "98.93",
                "home": "Xã V, Huyện M, NAM ĐỊNH",
                "home_prob": "96.54",
                "address": "Xã V, Huyện M, NAM ĐỊNH",
                "address_prob": "98.27",
                "address_entities": {
                    "province": "NAM ĐỊNH",
                    "district": "Huyện V",
                    "ward": "Xã V",
                    "street": ""
                },
                "overall_score": "99.47",
                "type": "new",
                "QRcode": "N/A"
            },
            {
                "ethnicity": "N/A",
                "ethnicity_prob": "N/A",
                "religion": "N/A",
                "religion_prob": "N/A",
                "features": "SẸO CHẤM",
                "features_prob": "99.78",
                "issue_date": "dd/mm/yyyy",
                "issue_date_prob": "99.31",
                "type_new": "new_back",
                "issue_loc": "CỤC TRƯỞNG CỤC CẢNH SÁT QUẢN LÝ HÀNH CHÍNH VỀ TRẬT TỰ XÃ HỘI",
                "issue_loc_prob": "95.70",
                "overall_score": "98.61",
                "type": "new_back",
                "mrz": "N/A",
                "mrz_prob": "N/A"
            }
        ]
    },
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.3435",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "303",
        "message": "face is not matching with document",
        "isMatch": "false",
        "similarity": "49.09",
        "warning": "N/A"
    },
    "resources": {
        "front": "url-front",
        "back": "url-back",
        "video": "url-video"
    }
}
2. Lấy dữ liệu eKYC từ API
Base URL
- 
Môi trường Staging: https://api.fpt.ai/vision/ekyc/be-stag
 - 
Môi trường Production: https://api.fpt.ai/vision/ekyc-be
 
2.1. Request Url
POST base_url/callback/get_result
2.2. Request Headers
| Tham số | Yêu cầu | Loại dữ liệu | Mô tả | Chú ý | 
|---|---|---|---|---|
| api-key | Có | String | API key của bạn để xác thực với hệ thống FPT AI eKYC | |
| uuid | Có | String | client_uuid mã ID của phiên do phía khách hàng sinh ra khi khởi tạo phiên | 
2.3. Mẫu request
curl --location --request POST 'base_url/callback/get_result' \
--header 'api-key: your-api-key' \
--header 'uuid: your-uuid'
2.4. Response
- Thành công: http_code = 
200 
{
    "uuid": "your-uuid",
    "code": "303",
    "message": "face is not matching with document",
    "ocr": {
        "code": "200",
        "message": "ocr successful",
        "data": [
            {
                "id": "0xxxxxxxxx9",
                "id_prob": "98.66",
                "name": "Nguyễn Văn A",
                "name_prob": "99.09",
                "dob": "dd/mm/yyyy",
                "dob_prob": "98.41",
                "sex": "NAM",
                "sex_prob": "98.30",
                "nationality": "VIỆT NAM",
                "nationality_prob": "99.77",
                "type_new": "cccd_12_front",
                "doe": "dd/mm/yyyy",
                "doe_prob": "98.93",
                "home": "Xã V, Huyện M, NAM ĐỊNH",
                "home_prob": "96.54",
                "address": "Xã V, Huyện M, NAM ĐỊNH",
                "address_prob": "98.27",
                "address_entities": {
                    "province": "NAM ĐỊNH",
                    "district": "Huyện V",
                    "ward": "Xã V",
                    "street": ""
                },
                "overall_score": "99.47",
                "type": "new",
                "QRcode": "N/A"
            },
            {
                "ethnicity": "N/A",
                "ethnicity_prob": "N/A",
                "religion": "N/A",
                "religion_prob": "N/A",
                "features": "SẸO CHẤM",
                "features_prob": "99.78",
                "issue_date": "dd/mm/yyyy",
                "issue_date_prob": "99.31",
                "type_new": "new_back",
                "issue_loc": "CỤC TRƯỞNG CỤC CẢNH SÁT QUẢN LÝ HÀNH CHÍNH VỀ TRẬT TỰ XÃ HỘI",
                "issue_loc_prob": "95.70",
                "overall_score": "98.61",
                "type": "new_back",
                "mrz": "N/A",
                "mrz_prob": "N/A"
            }
        ],
        "warning_data": [
            {
              "warning_code": "E30",
              "warning_message": "Front side and back side are not from the same card",
              "prediction_result": 1,
              "risk_level": 1,
              "confident_score": "N/A",
              "count": 1
            }
        ]
    },
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.3435",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "303",
        "message": "face is not matching with document",
        "isMatch": "false",
        "similarity": "49.09",
        "warning": "N/A"
    },
    "resources": {
        "front": "url-front",
        "back": "url-back",
        "video": "url-video"
    },
    "kyc_conclusion": {
        "decision": 2,
        "decision_message": "NEED_REVIEW",
        "risk_level": 1,
        "rule_table": [
            {
                "risk_level": 1,
                "group_code": "FC",
                "group_name": "ID Fraud Check",
                "rules": [
                    {
                        "warning_code": "FC03",
                        "warning_message": "Document has been edited or is colored photocopy",
                        "prediction_result": 1,
                        "risk_level": 1,
                        "confident_score": "0.8",
                        "count": 1
                    },
                ]
            },
            {
                "risk_level": 1,
                "group_code": "QC",
                "group_name": "ID Quality Check",
                "rules": [
                    {
                        "warning_code": "QC01",
                        "warning_message": "Image resolution is too low",
                        "prediction_result": 1,
                        "risk_level": 1,
                        "confident_score": "N/A",
                        "count": 2
                    },
                ]
            }
        ],
        "ocr_retry": 4,
        "face_retry": 3
    },
}
- 
Thất bại: Ví dụ một số mã lỗi
- 
http_code =
403{
"message": "Forbidden"
} - 
http_code =
404{
"message": "Not found data with uuid"
} 
 -